package cn.fastoo.common.dao.system;
import cn.fastoo.common.entity.product.ProductBrand;
import cn.fastoo.common.entity.system.SysModuleStatus;
import cn.fastoo.common.sampleframe.dao.FastDao;
import cn.fastoo.common.sampleframe.dao.impl.FastDaoImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.sql.DataSource;
import java.util.Date;


@Component
@Transactional
public class SysModuleStatusDao extends FastDaoImpl<SysModuleStatus> implements FastDao<SysModuleStatus> {


    @Autowired
    @Qualifier("mainDS")
    private void setJt(DataSource ds){
        this.jt = new JdbcTemplate(ds);
    }

    public Logger logger = LoggerFactory.getLogger(SysModuleStatusDao.class);

    @Override
    public void insert(SysModuleStatus sysModuleStatus) {
        sysModuleStatus.setCreateDate(new Date());
        sysModuleStatus.setUpdateDate(new Date());
        super.insert(sysModuleStatus);
    }
}
